﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MediaServer.Helper;
using System.IO;

namespace MediaServer.Controllers
{
    public class MovieController : Controller
    {
        //
        // GET: /Movie/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Overview()
        {
            List<string> model = new List<string>();
            foreach(FileInfo fi in new DirectoryInfo(@"C:\0work\debug\movies").EnumerateFiles())
            {
                model.Add(fi.FullName);
            }
            return Json(new
            {
                html = this.RenderViewToString("Overview", model)
            });
        }

    }
}
